package com.hubing.cloud.app.web.job;

import com.hubing.cloud.app.web.service.SearchHotService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class SearchJob {

    private static final String MAKE_HOT_CRON = "* * 0/1 * * ?";

    @Autowired
    private SearchHotService searchHotService;

    /**
     * 生成热搜
     */
    @Scheduled(cron = MAKE_HOT_CRON)
    private void makeHot() {
        // 多个执行给锁
        searchHotService.makeHot();
    }
}
